<?php
require_once("Elements.php");
		
class InvitationMessageForm extends Zend_Form {
	private $invited_user_id;
	private $invitation_id;
	private $permission;
	private $key;
	
	public function InvitationMessageForm($invited_user_id, $invitation_id, $permission, $key) {
		$this->invited_user_id = $invited_user_id;
		$this->invitation_id = $invitation_id;
		$this->permission = $permission;
		$this->key = $key;
		$this->__construct();
	}
	
	
	public function init() {
		$languageFile = Zend_Registry::get('languageFile');
        $translate = new Zend_Translate('array',$languageFile, 'zh_CN');
        $this->setTranslator($translate);
        $this->setName('invitationMessageForm');
		
		$this->setMethod('post');
		
		$elements = new Elements();
		$element = $elements->getCommentTextField();
		$element->setValue('');
		$element->removeDecorator('Label'); //Remove unneccesary dt label
		$this->addElement($element);

		$element = new Zend_Form_Element_Hidden('invited_user_id');
		$element->setValue($this->invited_user_id);
		$this->addElement($element);
		$element = new Zend_Form_Element_Hidden('invitation_id');
		$element->setValue($this->invitation_id);
		$this->addElement($element);
		
		if ($this->permission == 3) {
			$element = new Zend_Form_Element_Hidden('key');
			$element->setValue($this->key);
			$this->addElement($element);
		}
		
		$submit = $this->createElement('submit', 'submit');
		$submit->setName('post');
		$submit->removeDecorator('DtWrapper');
	//	$submit->removeDecorator('DtDdWrapper');	//Remove unneccesary dt label	
		$this->addElement($submit);
	}
	
}
?>